package com.baseframe.sms.builds;


import com.baseframe.sms.entity.Sms;

import com.baseframe.sms.template.SmsTemplate;
import com.baseframe.sms.template.TencentSmsTemplate;
import com.baseframe.sms.template.UniSmsTemplate;
import com.baseframe.sms.template.UnknownSmsTemplate;

import java.util.concurrent.ConcurrentHashMap;



public class SmsBuilds {


    private static final ConcurrentHashMap<String,Sms> POOL = new ConcurrentHashMap<>(16);




    public static <T> SmsTemplate getTemplate(Sms sms){

        SmsTemplate template = null;

        switch (sms.getType()){
            case UNI_SMS:
                template =  new UniSmsTemplate(sms);
                break;
            case TENCENT:
                template = new TencentSmsTemplate(sms);
                break;
            default:
                template =  new UnknownSmsTemplate(sms);

        }

        return template;
    }




}
